package com.engine4cloud.tdf.supervision.feign;

import com.engine4cloud.tdf.common.core.constant.SecurityConstants;
import com.engine4cloud.tdf.common.core.constant.ServiceNameConstants;
import com.engine4cloud.tdf.common.core.util.R;
import com.engine4cloud.tdf.common.data.web.response.PageInfo;
import com.engine4cloud.tdf.common.data.web.response.Params;
import com.engine4cloud.tdf.supervision.dto.create.RcglOccasionSignCreateDTO;
import com.engine4cloud.tdf.supervision.dto.query.RcglOccasionSignQueryDTO;
import com.engine4cloud.tdf.supervision.dto.result.RcglOccasionSignResultDTO;
import jakarta.validation.Valid;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;


/**
 * 日常管理-现场签到
 *
 * @author sh
 * @date 2024-08-02 15:07:07
 */
@FeignClient(contextId = "RemoteRcglOccasionSignService", value = ServiceNameConstants.SUPERVISION_SERVER)
public interface RemoteRcglOccasionSignService {

    /**
     * 新增矫正对象现场签到
     *
     * @param dto 矫正对象现场签到
     * @return R
     */
    @PostMapping("/inner/occasion/sign")
    R<Boolean> create(@Valid @RequestBody RcglOccasionSignCreateDTO dto, @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 通过id查询矫正对象现场签到
     *
     * @param id id
     * @return R
     */
    @GetMapping("/inner/occasion/sign/{id}")
    R<RcglOccasionSignResultDTO> getById(@PathVariable("id") Long id, @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 分页查询
     *
     * @param page 分页对象
     * @param dto  矫正对象现场签到
     * @return R<PageInfo < RcglOccasionSignResultDTO>>
     */
    @GetMapping("/inner/occasion/sign/page")
    R<PageInfo<RcglOccasionSignResultDTO>> pageList(@RequestParam("page") Params page, @Valid @RequestParam("dto") RcglOccasionSignQueryDTO dto, @RequestHeader(SecurityConstants.FROM) String from);
}
